<?php
namespace Core;

require_once __Dir__ . '/../../simpletest/autorun.php';

class TestOfAuthentification extends \UnitTestCase 
{
	/**
	* Check a correct authentification
	*
	* @reference
	*
	* @requirement
	* @requirement
	*/
    function testCorrectAuthentificate() 
	{
		$services = new CoreService();
		$result = $services->authenticate("gdidelot", sha1("stimorol"));
		
		$this->assertFalse($result->isFailed);
		$this->assertTrue(count($result->response) > 0);
    }
	
	/**
	* Check an invalid authentification
	*
	* @reference
	*
	* @requirement
	* @requirement
	*/
    function testInvalidAuthentificate() 
	{
		$services = new CoreService();
		$result = $services->authenticate("gdidelot", "stimorol");
		
		$this->assertTrue($result->isFailed);
    }
}
?>